package kdi.puzzle;

import kdi.main.R;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

public class Puzzle_main extends Activity {
	
	LinearLayout main_image;
	TextView tvTitle;
	
	static int mWidth, mHeight, mLength;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) { 
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		
		//메인 화면 배경그림
		main_image = (LinearLayout)findViewById(R.id.mainLinear);
		
		
		//메인화면 Button
		Button btStart = (Button)findViewById(R.id.btStart);
		Button btExti = (Button)findViewById(R.id.btExit);
		btStart.setOnClickListener(main_click_Listener);
		btExti.setOnClickListener(main_click_Listener);
		
		//화면의 상태가 세로인지 가로 인지 확인을 하는 것이다. 
		WindowManager wm = (WindowManager)getSystemService(Context.WINDOW_SERVICE);
		Display d = wm.getDefaultDisplay();
		mHeight = d.getHeight();
		mWidth = d.getWidth();
		mLength = mWidth>mHeight?mHeight:mWidth;
	
	}
	
	
	
	Button.OnClickListener main_click_Listener = new Button.OnClickListener() {
		@Override
		public void onClick(View v) {
			
			switch(v.getId()) {
			case R.id.btStart: // 메인화면 시작버튼
				Intent intent = new Intent(Puzzle_main.this, Puzzle_index.class);
				startActivity(intent);
				break;
			case R.id.btExit: // 메인화면 종료버튼
				finish();
				break;
			}
		}		
	};	
}